# import math

# def move(x, y, step, angle=0):
#     nx = x + step * math.cos(angle)
#     ny = y - step * math.sin(angle)
#     return nx, ny

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# import math

# def my_abs(x):
#     if not isinstance(x, (int, float)):
#         raise TypeError('bad operand type')
#     if x >= 0:
#         return x
#     else:
#         return -x

# def move(x, y, step, angle=0):
#     nx = x + step * math.cos(angle)
#     ny = y - step * math.sin(angle)
#     return nx, ny

# n = my_abs(-20)
# print(n)

# x, y = move(100, 100, 60, math.pi / 6)
# print(x, y)

# # TypeError: bad operand type:
# my_abs('123')

# def power(x)
# x = 6
# print(x)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# from collections.abc import Iterable


# def g():
#     yield 1
#     yield 2
#     yield 3


# print("Iterable? [1, 2, 3]:", isinstance([1, 2, 3], Iterable))
# print("Iterable? 'abc':", isinstance("abc", Iterable))
# print("Iterable? 123:", isinstance(123, Iterable))
# print("Iterable? g():", isinstance(g(), Iterable))

# # iter list:
# print("for x in [1, 2, 3, 4, 5]:")
# for x in [1, 2, 3, 4, 5]:
#     print(x)

# print("for x in iter([1, 2, 3, 4, 5]):")
# for x in iter([1, 2, 3, 4, 5]):
#     print(x)

# print("next():")
# it = iter([1, 2, 3, 4, 5])
# print(next(it))
# print(next(it))
# print(next(it))
# print(next(it))
# print(next(it))

# d = {"a": 1, "b": 2, "c": 3}

# # iter each key:
# print("iter key:", d)
# for k in d.keys():
#     print("key:", k)

# # iter each value:
# print("iter value:", d)
# for v in d.values():
#     print("value:", v)

# # iter both key and value:
# print("iter item:", d)
# for k, v in d.items():
#     print("item:", k, v)

# # iter list with index:
# print("iter enumerate(['A', 'B', 'C']")
# for i, value in enumerate(["A", "B", "C"]):
#     print(i, value)

# # iter complex list:
# print("iter [(1, 1), (2, 4), (3, 9)]:")
# for x, y in [(1, 1), (2, 4), (3, 9)]:
#     print(x, y)

# print(list(range(1, 11))
# )

# L = []
# for x in range(1, 11):
#     L.append(x * x)

# L = [x * x for x in range(1, 11)]
# print(L)

# print(abs(-10))

# def add(x, y, f):
#     return f(x) + f(y)

# print(add(-5, 6, abs))

# L = []
# for n in [1, 2, 3, 4, 5, 6, 7, 8, 9]:
#     L.append(f(n))
# print(L)

# def normalize(name):
#     pass

# # 测试:
# L1 = ['adam', 'LISA', 'barT']
# L2 = list(map(normalize, L1))
# print(L2)

# def is_palindrome(n):
#     pass

# # 测试:
# output = filter(is_palindrome, range(1, 1000))
# print('1~1000:', list(output))
# if list(filter(is_palindrome, range(1, 200))) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191]:
#     print('测试成功!')
# else:
#     print('测试失败!')

# print(sorted([36, 5, -12, 9, -21]))


# print(sorted([36, 5, -12, 9, -21], key=abs))

# L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]

# def by_name(t):
#     pass

# L2 = sorted(L, key=by_name)
# print(L2)

# print(100 + 200 + 300)

# print('hello, world')

# name = ('Michael')
# print(name)

# name = input('please enter your name: ')
# print('hello,', name)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# name = input('what\'s your name? ')
# print('Hello,', name)

# TODO:
print(1024 * 768)